//
//  LZFinancialRecordsCell.m
//  laziz_Merchant
//
//  Created by xbnzd on 16/12/18.
//  Copyright © 2016年 XBN. All rights reserved.
//

#import "LZFinancialRecordsCell.h"
#import "LZFinancialPayedModel.h"
#import "LZDateFormatterManager.h"
#import "UIView+Rotation.h"

@interface LZFinancialRecordsCell()
@property (weak, nonatomic) IBOutlet UILabel *serialNumberLabel;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *serialNumberLabelWidth;
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *timeLabelWidth;
@property (weak, nonatomic) IBOutlet UILabel *amountLabel;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *amountWidth;
@property (weak, nonatomic) IBOutlet UIImageView *rightArrowImg;


@end

@implementation LZFinancialRecordsCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    
    [self.rightArrowImg setLanguageRotaion];
    [self configureWidth];
   
}

- (void)setFModel:(LZFinancialPayedModel *)fModel
{
    _fModel = fModel;
    self.serialNumberLabel.text = fModel.payNumber;
    self.timeLabel.text = [[LZDateFormatterManager shareInstance] stringFromStringNormalHaveLineyyyyMMdd:fModel.payTime];
    self.amountLabel.text = [NSString stringWithFormat:@"%.3fBHD",fModel.payMoney];
}

- (void)configureWidth
{
    GET_SCREEN_WIDTH(cellWidth);
    _serialNumberLabelWidth.constant = (cellWidth - 92)*0.4;
    _timeLabelWidth.constant = (cellWidth - 92)*0.3;
    _amountWidth.constant = (cellWidth - 92)*0.3;
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
